package com.zr.controller;

import com.github.pagehelper.PageInfo;
import com.zr.pojo.Orders;
import com.zr.service.OrdersService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;

@Controller
public class OrderController {

    @Resource
    private OrdersService service;

    /**查询所有的订单*/
    @RequestMapping("/orderList")
    public String orderList(@RequestParam(value="pageNum",defaultValue = "1")Integer pageNum, Model model){
//        String uid = (String) session.getAttribute("uid");
        PageInfo<Orders> pi = service.selectByPage("3",pageNum,3);
        model.addAttribute("pageInfo",pi);
        return "order";
    }


}
